package org.openbpm.sys.core.manager.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.openbpm.base.manager.impl.BaseServiceImpl;
import org.openbpm.sys.core.manager.SysOperateLogMetaManager;
import org.openbpm.sys.core.mapper.SysOperateLogMetadataMapper;
import org.openbpm.sys.core.model.SysOperateLogMetadata;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysOperateLogMetaManagerImpl extends BaseServiceImpl<SysOperateLogMetadataMapper, SysOperateLogMetadata> implements SysOperateLogMetaManager {

    //@Cacheable("operateLogMeta")
    public List<SysOperateLogMetadata> loadMetaListByPath(String path){
        LambdaQueryWrapper<SysOperateLogMetadata> queryWrapper = new LambdaQueryWrapper<SysOperateLogMetadata>();
        queryWrapper.eq(SysOperateLogMetadata::getEnabled, Boolean.TRUE).likeRight(SysOperateLogMetadata::getPath, path);
        return  super.list(queryWrapper);
    }
}
